package edu.jiefengli.course_selection_system.service.impl;

import edu.jiefengli.course_selection_system.mapper.CourseMappper;
import edu.jiefengli.course_selection_system.pojo.entity.Course;
import edu.jiefengli.course_selection_system.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {

    @Autowired
    private CourseMappper courseMappper;

    @Override
    public void addCourse(Course course) {
        courseMappper.addCourse(course);
    }

    @Override
    public void updateCourse(Course course) {
        courseMappper.updateCourse(course);
    }

    @Override
    public Course getCourseById(int id) {
        return courseMappper.getCourseById(id);
    }

    @Override
    public List<Course> getCourseByTeacherId(int id) {
        return courseMappper.getCoursesByTeacherId(id);
    }

    @Override
    public List<Course> getAllCourses() {
        return courseMappper.getAllCourses();
    }
}
